/**
 * MCU 厂家 SDK 适配层
 * Copyright (c) 2021 深圳市智辰科技有限公司
 * All rights reserved.
 */

#include <esp_system.h>
#include <esp_heap_caps.h>

#include "sdk.h"


int rand(void) {
	return esp_random();
}

void logmem() {
	//heap_caps_print_heap_info(MALLOC_CAP_8BIT);
	printf("Heap: free/total = %d / %d, min/max = %d / %d\r\n",
		heap_caps_get_free_size(MALLOC_CAP_8BIT),
		heap_caps_get_total_size(MALLOC_CAP_8BIT),
		heap_caps_get_minimum_free_size(MALLOC_CAP_8BIT),
		heap_caps_get_largest_free_block(MALLOC_CAP_8BIT));
}
